Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish lint and styling actions #295

Merged
merged 67 commits into from
Sep 16, 2024
Merged

Conversation

philipp-baumann
Copy link
Collaborator

No description provided.

@philipp-baumann
Copy link
Collaborator Author

philipp-baumann commented Sep 13, 2024

@philipp-baumann philipp-baumann changed the title Do pre-commit code checks and apply formatting via precommit-ci-lite bot Polish code formatter and styling actions Sep 16, 2024
@philipp-baumann philipp-baumann changed the title Polish code formatter and styling actions Polish lint and styling actions Sep 16, 2024
@philipp-baumann
Copy link
Collaborator Author

philipp-baumann commented Sep 16, 2024

take home/lessions learnt:

  • styler action: tweak styling in this action so that the R setup is bootstrapped via nix and our root default.nix with the necessary dev packages. adapt https://github.com/r-lib/httr2/blob/main/.github/workflows/pr-commands.yaml ; we now have auto-fixing in the PR, only if we have changes.

  • combine styling and linting. for linting, {lintr} is used. the styler action can write and auto-commit fixes, however the linter is not an auto-formatter. styler does very basic styling, and has caveats, and unfortunately has no auto-fixing of the line length implemented.

  • I disabled the pre-commit setup provided via {precommit}. it seems unrealistic and not straight-forward to port a pre-commit hook specifically for R into a nix-approach. Mainly because all R-agnostic tooling in pre-commit is initialized via python virtualenv and also mainly using {renv}, which very cumbersome and also not appropriate for porting into a clean nix approach. There is various race conditions and also there is currently problems with the cache (via R.cache), which are currently not fixed in styler.

@philipp-baumann philipp-baumann merged commit 1783f72 into main Sep 16, 2024
1 of 8 checks passed
@philipp-baumann philipp-baumann deleted the precommit-ci-lite-linter branch September 16, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants